import Vue from 'vue'
import SstFaceAuthentication from './index.vue'
let HSstFaceAuthentication = Vue.extend(SstFaceAuthentication)
let instance
const FaceAuthentication = function (options = {}) {
  // 初始化实例，此时instance是一个组件实例，但未初始化未完成
  instance = new HSstFaceAuthentication({
    data: options
  })
  // 完成初始化
  instance.$mount()
  // 将组件添加到根节点body
  document.body.appendChild(instance.$el)
}
FaceAuthentication.open = function () {
  FaceAuthentication()
  instance.modal = true
}
export default FaceAuthentication
